# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=openspecfun
pkgver=0.5.6
pkgrel=0
pkgdesc="A collection of special mathematical functions."
url="https://github.com/JuliaMath/openspecfun"
# s390x and riscv64 blocked by openlibm
arch="all !s390x !riscv64"
license="MIT Public-Domain"
makedepends="openlibm-dev gfortran"
options="!check" # no tests
subpackages="$pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/JuliaLang/openspecfun/archive/v$pkgver.tar.gz
	openspecfun.pc
	"

build() {
	make USE_OPENLIBM=1 prefix=/usr
	sed "s/@VERSION@/$pkgver/" "$srcdir"/$pkgname.pc > $pkgname.pc
}

package() {
	make DESTDIR="$pkgdir" prefix=/usr install
	install -D $pkgname.pc "$pkgdir"/usr/lib/pkgconfig/$pkgname.pc
}

sha512sums="
1f92047aa60354f7296d22a5b64362af0204df3d58ff0b3129d2fe24818a576aefce6f94ae44219c96d0e44f68d8c57d1f42caf2d8f5bd55a2fe0a6498fd6df5  openspecfun-0.5.6.tar.gz
4546252dbe5d4b563439047df1d75fadb73e00b0c6389220ae6f242f1aa0344e54f87dc9a86edca66779bcb07716bcd6a173178bff54d3aeeb48804cfda64e4d  openspecfun.pc
"
